// 退出功能
$('#logout').on('click',function(){
    $.ajax({
        type:'post',
        url:'/logout',
        success:function(){
            //跳转到登录页面
            location.href = './login.html'
        }
    })
})

//当前登录的用户头像和昵称设置
$.ajax({
    type:'get',
    url:`/users/${userId}`,
    success:function(res){
        console.log(res)
        $('.profile .avatar').attr('src',res.avatar)
        $('.profile h3').text(res.nickName)
        // $('.profile').css('visibility','visible')
    }
})